<?php
    namespace framework;
    class module
    {
        protected $viewVariables;
        protected $requestMethod;
        protected $request;
        protected function __construct()
        {
            $this -> viewVariables = $this -> request = array();
            if($_POST || $_GET)
            {
                if($_POST)
                {
                    $this -> requestMethod = 'POST';
                    $requestVariables = $_POST;
                }
                else
                {
                    $this -> requestMethod = 'GET';
                    $requestVariables = $_GET;
                }
                foreach($requestVariables as $variableName => $variableValue)
                {
                    $this -> request[$variableName] = $variableValue;
                }
                $_POST = $_GET = array();
            }
        }
        public function __set($variableName, $variableValue)
        {
            $this -> viewVariables[$variableName] = $variableValue;
        }
        public function __get($variableName)
        {
            return $this -> viewVariables[$variableName];
        }
        public function getViewVariables()
        {
            return $this -> viewVariables;
        }
    }